package com.study;

import cn.hutool.core.io.FileUtil;
import cn.hutool.http.HttpUtil;

/**
 * @Description: TODO
 * @Author: csc
 * @Date: 2024/4/24 10:51
 * @Version: 1.0
 **/
public class HttpDownload {

    public static void main(String[] args) {
          //file1不掉转的地址
        String file1="https://10.10.253.2/evo-apigw/evo-oss/ba06f5b5-651f-11ee-b16c-e8611a0a8b5f/20240424/1/0412db4b-01d5-11ef-b004-e8611a0a8b5f.jpg?token=23:B6gujh8IF9iirL8qiUydXYLg9zMNU9g5";
        //file2跳转后的地址
        String file2 = "https://10.10.253.2/evo-pic/ba06f5b5-651f-11ee-b16c-e8611a0a8b5f/20240424/1/0412db4b-01d5-11ef-b004-e8611a0a8b5f.jpg?token=23:B6gujh8IF9iirL8qiUydXYLg9zMNU9g5&oss_addr=10.10.253.2:9876";

//     //将文件下载后保存在E盘，返回结果为下载文件大小  现在下载的是file2 不跳转的地址
//        long size = HttpUtil.downloadFile(file2, FileUtil.file("E:\\桌面1\\图片下载"));
//        System.out.println("下载 成功Download size: " + size);

        String s = HttpUtil.get(file1);
        System.out.println(s);
    }
}
